package
{
	import flash.display.Sprite;
	import flash.net.SharedObject;
	import flash.net.SharedObjectFlushStatus;
	import flash.net.registerClassAlias;
	import flash.system.Security;
	import flash.system.SecurityPanel;
	
	import model.Person;
	
	public class TestLSO extends Sprite
	{
		public function TestLSO()
		{
			super();
			//registerClassAlias("model.Person", Person);
			var so:SharedObject = SharedObject.getLocal("example2", "/");
			if (so.data.id != undefined){
				trace("id="+so.data.id);
				trace("name="+so.data.name);
				so.clear();
			}
			else{
				so.data.id = 12356;
				so.data.name = "testName";
				var result:String = so.flush();
				if (result == SharedObjectFlushStatus.FLUSHED){
					trace("flush finish");
				}
			}
//			trace("id="+so.data.id);
//			trace("name="+so.data.name);
//			Security.showSettings(SecurityPanel.LOCAL_STORAGE);
//			var flushResult:String;
//			if (so.data.person == null){
//				trace("first save person");
//				var p:Person = new Person();
//				so.data.person = p;
//				flushResult = so.flush();
//				
//			}
//			else{
//				trace(so.data.person.desc());
//				delete so.data.person;
//				flushResult = so.flush();
//			}
//			trace("result:"+flushResult);
			trace("okkkkkkkkkkkkkkkkkkkkkkk");
		}
	}
}